package gui.baseListeners;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.events.SelectionEvent;

public class ResetSelected extends SelectionAdapter {

	private Shell shell;
	
	public ResetSelected(){
		super();
	}
	
	public ResetSelected(Shell shell){
		this.shell = shell;
	}
	
	public void widgetSelected(SelectionEvent event){
		Control [] children = shell.getChildren();
		for(int i = 0; i < children.length; i++){
			if(children[i].getClass().getSimpleName().equalsIgnoreCase("Text")){
				((Text) children[i]).setText("");
			}
		}
	}
}
